package com.cnfilm.gather;

public enum GatherURL {
	
	KONGFU("动作","http://hao.uoso.net/?s=vod-show-id-1.html","kongfu", 1),
	COMEDY("喜剧","http://hao.uoso.net/?s=vod-show-id-2.html","comedy",  2), 
	LOVE("爱情","http://hao.uoso.net/?s=vod-show-id-3.html","love",  3), 
	SCIENCE("科幻","http://hao.uoso.net/?s=vod-show-id-4.html","science",  4), 
	TERROR("恐怖","http://hao.uoso.net/?s=vod-show-id-5.html","terror",  5), 
	STORY("剧情","http://hao.uoso.net/?s=vod-show-id-6.html","story",  6), 
	WAR("战争","http://hao.uoso.net/?s=vod-show-id-13.html","war",  7);  
	
    // 成员变量  
    private String name; 
    private String url; 
    private String type; 
    private int index;  
    
    // 构造方法  
    private GatherURL(String name,String url,String type,int index) {  
        this.name = name;  
        this.url = url;  
        this.type = type;  
        this.index = index;  
    }  
   
    // 普通方法  
    public static String getUrl(int index) {  
        for (GatherURL c : GatherURL.values()) {  
            if (c.getIndex() == index) {  
                return c.url;  
            }  
        }  
        return null;  
    } 
    
    // 普通方法  
    public static int getIndex(String type) {  
        for (GatherURL c : GatherURL.values()) {  
            if (c.getType() == type) {  
                return c.index;  
            }  
        }  
        return 1;  
    } 
    
    // get set 方法  
    public String getName() {  
        return name;  
    }  
    public void setName(String name) {  
        this.name = name;  
    } 
    public String getType() {  
        return type;  
    }  
    public void setType(String type) {  
        this.type = type;  
    } 
    public String getUrl() {  
        return url;  
    }  
    public void setUrl(String url) {  
        this.url = url;  
    } 
    public int getIndex() {  
        return index;  
    }  
    public void setIndex(int index) {  
        this.index = index;  
    }

}
